package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysPatrolMapper;
import com.ruoyi.project.system.domain.SysPatrol;
import com.ruoyi.project.system.service.ISysPatrolService;

/**
 * 巡查Service业务层处理
 * 
 * @author jjp
 * @date 2020-03-29
 */
@Service
public class SysPatrolServiceImpl implements ISysPatrolService 
{
    @Autowired
    private SysPatrolMapper sysPatrolMapper;

    /**
     * 查询巡查
     * 
     * @param patrolId 巡查ID
     * @return 巡查
     */
    @Override
    public SysPatrol selectSysPatrolById(Long patrolId)
    {
        return sysPatrolMapper.selectSysPatrolById(patrolId);
    }

    /**
     * 查询巡查列表
     * 
     * @param sysPatrol 巡查
     * @return 巡查
     */
    @Override
    public List<SysPatrol> selectSysPatrolList(SysPatrol sysPatrol)
    {
        return sysPatrolMapper.selectSysPatrolList(sysPatrol);
    }

    /**
     * 新增巡查
     * 
     * @param sysPatrol 巡查
     * @return 结果
     */
    @Override
    public int insertSysPatrol(SysPatrol sysPatrol)
    {
        sysPatrol.setCreateTime(DateUtils.getNowDate());
        return sysPatrolMapper.insertSysPatrol(sysPatrol);
    }

    /**
     * 修改巡查
     * 
     * @param sysPatrol 巡查
     * @return 结果
     */
    @Override
    public int updateSysPatrol(SysPatrol sysPatrol)
    {
        return sysPatrolMapper.updateSysPatrol(sysPatrol);
    }

    /**
     * 批量删除巡查
     * 
     * @param patrolIds 需要删除的巡查ID
     * @return 结果
     */
    @Override
    public int deleteSysPatrolByIds(Long[] patrolIds)
    {
        return sysPatrolMapper.deleteSysPatrolByIds(patrolIds);
    }

    /**
     * 删除巡查信息
     * 
     * @param patrolId 巡查ID
     * @return 结果
     */
    @Override
    public int deleteSysPatrolById(Long patrolId)
    {
        return sysPatrolMapper.deleteSysPatrolById(patrolId);
    }
}
